import request from '../utils/axios.js';


//分页查询以及条件分页
export const empListPage = (query, empQuery) => {
    return request({
        url: '/emp/' + query.pageNo + "/" + query.limit,
        method: 'post',
        data: empQuery
    });
};

//查询部门信息以及岗位信息
export const deptList = () => {
    return request({
        url: '/emp/deptListName',
        method: 'get',
    });
};

//id查询信息
export const empListById = (empId) => {
    return request({
        url: '/emp/empListById/' + empId,
        method: 'post',
    });
};

//查询所有政治面貌
export const educationList = () => {
    return request({
        url: '/emp/educationList',
        method: 'get',
    });
};

//查询所有学历
export const politicalList = () => {
    return request({
        url: '/emp/politicalList',
        method: 'get',
    });
};

//查询所有岗位
export const postList = () => {
    return request({
        url: '/emp/postList',
        method: 'get',
    });
};

//查询所有角色
export const roleList = () => {
    return request({
        url: '/emp/roleList',
        method: 'get',
    });
};

//添加员工
export const addEmp = (emp, posts) => {
    return request({
        url: '/emp/addEmp/' + posts,
        method: 'post',
        data: emp
    });
};

//修改员工信息
export const empAmend = (emp) => {
    return request({
        url: '/emp/empAmend',
        method: 'post',
        data: emp
    });
};

//删除员工信息
export const empDeleteById = (empId) => {
    return request({
        url: '/emp/empDeleteById/' + empId,
        method: 'post'
    });
};

//图片上传
export const uploadImg = (params) => {
    return request({
        method: 'post',
        url: `/emp/uploadImg`,
        data: params,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}